<?php

namespace app\api\validate;

use think\Validate;

class GroupValidate extends Validate
{
    //定义验证规则
    protected $rule = [
        'uid|用户id' => 'require',
        'url|群头像' => 'require',
        'members|初始群成员' => 'require',
        'group_category_id|群分类' => 'require',
        'type|群类型' => 'require',
        'group_name|群名称group_name' => 'require',
        'group_id|群id group_id' => 'require',
        'page|页码' => 'require',
        'limit|每页多少条' => 'require',
    ];

    //定义验证提示
    protected $message = [
        'uid.require' => '缺少参数uid',
        'url.require' => '缺少参数 群头像',
        'group_category_id.require' => '缺少参数 群分类',
        'members.require' => '缺少参数 初始群成员',
        'type.require' => '缺少参数 群类型',
        'group_name.require' => '缺少参数 群名称group_name',
        'group_id.require' => '缺少参数 群id group_id',
        'limit.require' => '缺少参数 条数 limit',
        'page.require' => '缺少参数 条数 page',
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'addGroup' => ['group_category_id','group_name','type'],
        'addGroupUser' => ['group_id','members'],
        'updateGroup' => ['group_name','group_id'],
        'delGroup' => [ 'group_id'],
        'getOlineGroup' => [ 'group_id'],//直播群id
        'list' => ['group_category_id','page','limit'],
    ];


}
